/**
 * 
 */
package br.org.bertol.zennote.admin;

import com.opensymphony.xwork2.ActionSupport;

/**
 * @author P9902475
 */
public class Login
    extends ActionSupport
{
	private static final long serialVersionUID = -5549797973785669273L;

	public String execute () throws Exception
	{
		if (isInvalid(getUsername())) return ERROR;

		if (isInvalid(getPassword())) return ERROR;

		return SUCCESS;
	}

	private boolean isInvalid (String value)
	{
		return (value == null || value.length() == 0);
	}

	private String username;

	public String getUsername ()
	{
		return username;
	}

	public void setUsername (String username)
	{
		this.username = username;
	}

	private String password;

	public String getPassword ()
	{
		return password;
	}

	public void setPassword (String password)
	{
		this.password = password;
	}

}
